a, b = [x for x in input().split(' ')]
n = 0
ans = ''
if a == b:
    n = 2
    ans = f'{a}\n{a}{a}'
else:
    n = 4
    ans = f'{a}\n{b}\n{a}{b}\n{b}{a}'
print(n)
print(ans)
